home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / AboveBelow.dxr / Internal_9_f otsprot.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  3.9 KB  |  123 lines

  1. property spriteNum, row
  2. global stock, foundation, equal, currentsel, getlist, godlist, basecard, leftlist, rightlist
  3.  
  4. on beginSprite me
  5.   if listp(foundation) = 0 then
  6.     foundation = [:]
  7.   end if
  8.   row = determinerow()
  9.   foundation.addProp(row, new(script("card pile")))
  10. end
  11.  
  12. on determinerow me
  13.   if spriteNum = 29 then
  14.     return #fone
  15.   else
  16.     if spriteNum = 30 then
  17.       return #ftwo
  18.     else
  19.       if spriteNum = 31 then
  20.         return #fthree
  21.       else
  22.         if spriteNum = 32 then
  23.           return #ffour
  24.         else
  25.           if spriteNum = 33 then
  26.             return #ffive
  27.           else
  28.             if spriteNum = 34 then
  29.               return #fsix
  30.             else
  31.               if spriteNum = 35 then
  32.                 return #fseven
  33.               else
  34.                 if spriteNum = 36 then
  35.                   return #feight
  36.                 end if
  37.               end if
  38.             end if
  39.           end if
  40.         end if
  41.       end if
  42.     end if
  43.   end if
  44. end
  45.  
  46. on mouseEnter me
  47.   if getlist <> VOID then
  48.     if foundation[row].getcardcount() < 13 then
  49.       if (row = #fone) or (row = #ftwo) or (row = #fthree) or (row = #ffour) then
  50.         if not listp(leftlist) then
  51.           leftlist = []
  52.         end if
  53.         if sprite(spriteNum - 8).member.name = "empty" then
  54.           if (getlist.getlastcard().rankvalue = (basecard.rankvalue + 1)) and not leftlist.findPos(getlist.getlastcard().suit) then
  55.             equal = 1
  56.             godlist = foundation[row]
  57.             currentsel = spriteNum - 8
  58.           end if
  59.         else
  60.           if (getlist.getlastcard().rankvalue = (foundation[row].getlastcard().rankvalue + 1)) and (getlist.getlastcard().suit = foundation[row].getlastcard().suit) then
  61.             equal = 1
  62.             godlist = foundation[row]
  63.             currentsel = spriteNum - 8
  64.           else
  65.             if (getlist.getlastcard().rank = "ace") and (foundation[row].getlastcard().rank = "king") and (getlist.getlastcard().suit = foundation[row].getlastcard().suit) then
  66.               equal = 1
  67.               godlist = foundation[row]
  68.               currentsel = spriteNum - 8
  69.             end if
  70.           end if
  71.         end if
  72.       else
  73.         if (row = #ffive) or (row = #fsix) or (row = #fseven) or (row = #feight) then
  74.           if not listp(rightlist) then
  75.             rightlist = []
  76.           end if
  77.           if sprite(spriteNum - 8).member.name = "empty" then
  78.             if (getlist.getlastcard().rankvalue = (basecard.rankvalue - 1)) and not rightlist.findPos(getlist.getlastcard().suit) then
  79.               equal = 1
  80.               godlist = foundation[row]
  81.               currentsel = spriteNum - 8
  82.             end if
  83.           else
  84.             if (getlist.getlastcard().rankvalue = (foundation[row].getlastcard().rankvalue - 1)) and (getlist.getlastcard().suit = foundation[row].getlastcard().suit) then
  85.               equal = 1
  86.               godlist = foundation[row]
  87.               currentsel = spriteNum - 8
  88.             else
  89.               if (getlist.getlastcard().rank = "king") and (foundation[row].getlastcard().rank = "ace") and (getlist.getlastcard().suit = foundation[row].getlastcard().suit) then
  90.                 equal = 1
  91.                 godlist = foundation[row]
  92.                 currentsel = spriteNum - 8
  93.               end if
  94.             end if
  95.           end if
  96.         end if
  97.       end if
  98.     end if
  99.   end if
  100. end
  101.  
  102. on mouseLeave me
  103.   equal = 0
  104.   currentsel = 0
  105.   godlist = VOID
  106. end
  107.  
  108. on golem me
  109.   if foundation[row].getcardcount() = 1 then
  110.     if (row = #fone) or (row = #ftwo) or (row = #fthree) or (row = #ffour) then
  111.       if not leftlist.findPos(foundation[row].cards[1].suit) then
  112.         leftlist.add(foundation[row].cards[1].suit)
  113.       end if
  114.     else
  115.       if (row = #ffive) or (row = #fsix) or (row = #fseven) or (row = #feight) then
  116.         if not rightlist.findPos(foundation[row].cards[1].suit) then
  117.           rightlist.add(foundation[row].cards[1].suit)
  118.         end if
  119.       end if
  120.     end if
  121.   end if
  122. end
  123.